import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';

import { VarTest, VarTestDocument } from './schema/varTest.schema';
import { VarTestChild, VarTestChildDocument } from './schema/varTestChild.schema';

@Injectable()
export class MongodbService {
  @InjectModel(VarTest.name)
  readonly VarTestModel: Model<VarTestDocument>;

  @InjectModel(VarTestChild.name)
  readonly VarTestChildModel: Model<VarTestChildDocument>;
}

// @Injectable()
// export class MongodbService {
//   constructor(
//     // 人员模型
//     @InjectModel(User.name, 'UserDB')
//     readonly UserModel: Model<UserDocument>,

//     // 部门模型
//     @InjectModel(Depart.name, 'DepartDB')
//     readonly DepartModel: Model<DepartDocument>,
//   ) {}
// }
